# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-neobolt
pkgname=('python2-neobolt' 'python-neobolt')
_pkgname=neobolt
pkgver=1.7.17
pkgrel=6
pkgdesc='Neo4j Bolt connector for Python.'
arch=('x86_64' 'aarch64')
url='https://pypi.org/project/neobolt/#files'
license=('APACHE')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('a9329e03924616dbf1ab70bd04143c0a20a3d88735d2a37acb9c4b663528f8b9f421b241c4c4ebf7fbd6ce590029a61cd9c3178adf57df6908f4382580ae8785')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-neobolt() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-neobolt() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

